/*
 * Copyright (c) 1997 - 2012 Rakuten, Inc. All Rights Reserved.
 * $Id$
 * Created on 2012/05/29
 */
package com.rakuten.api.mule.model.item;

import java.util.Date;

import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonPropertyOrder;
import org.codehaus.jackson.map.annotate.JsonSerialize;

/**
 *
 * @author hayatsu
 */
@JsonPropertyOrder({
	"liveStartTime",
	"liveEndTime"
})
@JsonAutoDetect
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
public class ItemDuration{

	private String liveStartTime;
	private String liveEndTime;

	public ItemDuration(){
	}

	public ItemDuration(String liveStartTime, String liveEndTime){
		this.liveStartTime=liveStartTime;
		this.liveEndTime=liveEndTime;
	}

	public String getLiveStartTime(){
		return liveStartTime;
	}

	public void setLiveStartTime(String liveStartTime){
		this.liveStartTime=liveStartTime;
	}

	public String getLiveEndTime(){
		return liveEndTime;
	}

	public void setLiveEndTime(String liveEndTime){
		this.liveEndTime=liveEndTime;
	}

	public boolean isLive(long currentTimeMillis){
		/*assume null values means infinity(negative for startTime, positive for endTime)
		if(liveStartTime!=null&&liveStartTime.getTime()>currentTimeMillis)
			return false;
		if(liveEndTime!=null&&liveEndTime.getTime()<currentTimeMillis)
			return false;
		*/	
		return true;
	}
}
